package com.desire.filter;

import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;
import com.netflix.zuul.exception.ZuulException;

/**
 * @Description:
 * @Author: littleDesire
 * @Date: 2022-06-10 9:49
 * @Version: 1.0
 */
public class RouterFilter extends ZuulFilter {
    @Override
    public String filterType() {
        return "pre";
    }

    @Override
    public int filterOrder() {
        return 1;
    }

    @Override
    public boolean shouldFilter() {
        return true;
    }


    @Override
    public Object run() throws ZuulException {
        RequestContext requestContext = RequestContext.getCurrentContext();
//        String token = requestContext.get("token").toString();
//        if (token!=null){
//            System.out.println("token:"+token);
//        }
        return null;
    }
}
